package com.decent.web.system.dao.provider;

import com.decent.web.system.dto.SystemBrandDTO;

import java.util.Map;

/**
 * @author: decent Gjh
 * @date: 2022/10/26/9:51
 * @description:
 */

public class SystemBrandDaoProvider {

    /**
     * 列表查询
     * @param params 查询条件
     * @return 结果
     */
    public String list(Map<String, SystemBrandDTO> params) {
        SystemBrandDTO dto = params.get("brand");
        StringBuilder sql = new StringBuilder(128);
        sql.append("select * from common_brand where sort > 0 ");
        if (dto.getClassifyId() != null && dto.getClassifyId()!=0){
            sql.append(" and classify_id = #{brand.classifyId}");
        }
        sql.append(" order by sort asc ");
        return sql.toString();
    }

}
